from PIL import Image
from selenium import webdriver
import pytesseract
driver = webdriver.Chrome()
driver.get('url');driver.save_screenshot('G:/imooc.png')
element = driver.find_element_by_id('')

left = element.location['x']
top = element.location['y']
right = element.size['width']+left
height = element.size['height']+top

im = Image.open('G:/imooc.png')
img = im.crop((left,top,right,height))
img.save('G:/imooc.png01')
img01 = Image.open('G:/imooc.png01')

pytesseract.image_to_string(img01)